﻿using System;
using System.Collections;

namespace Social_Network_Analyzer
{
    class Clique
    {
        private ArrayList _cliqueMembers = new ArrayList();

        /// <summary>
        /// Starts a new clique.  A clique is a group of 3 or more people.
        /// </summary>
        public Clique()
        { }

        public void addPerson(Person newPerson)
        {
            if (!_cliqueMembers.Contains(newPerson))
                _cliqueMembers.Add(newPerson);
        }

        public int getCliqueSize()
        {
            return _cliqueMembers.Count;
        }

        public Person getMember(int index)
        {
            return _cliqueMembers[index] as Person;
        }

        public void outputMembers()
        {
            Console.WriteLine("-----------------------");
            foreach (Person p in _cliqueMembers)
                Console.WriteLine("\t" + p.vertexId + " " + p.name);
            Console.WriteLine("-----------------------");
        }
    }
}
